#ifndef ENCRYTHIONIMPLEM_H
#define ENCRYTHIONIMPLEM_H

#include <QString>
#include <iostream>
#include <cassert>
#include <string>
#include <cstring>
#include <vector>


class EncrythionImpl{

public:
     EncrythionImpl(){}

     //md5摘要哈希
     void md5(const std::string &srcStr, std::string &encodedStr, std::string &encodedHexStr);
     //sha256摘要哈希
     void sha256(const std::string &srcStr, std::string &encodedStr, std::string &encodedHexStr);

     //des 对称加解密
     // 加密 ecb模式
     std::string des_encrypt(const std::string &clearText, const std::string &key);
     // 解密 ecb模式
     std::string des_decrypt(const std::string &cipherText, const std::string &key);

     //生成密钥对RSAkey
     void generateRSAKey(std::string strKey[2]);
     // 公钥加密
     std::string rsa_pub_encrypt(const std::string &clearText, const std::string &pubKey);
     // 私钥解密
     std::string rsa_pri_decrypt(const std::string &cipherText, const std::string &priKey);

     //私钥加密
     QString rsa_pri_encrypt_base64 (const QString& strClearData, const std::string &pubKey);
     //公钥解密
     QString rsa_pub_decrypt_base64(const QString& strDecryptData, const std::string &pubKey);

};

#endif // ENCRYTHIONIMPLEM_H
